# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Omar Pakker <archlinux@opakker.nl>

pkgname=python-bidict
_name=${pkgname#python-}
pkgver=0.22.1
pkgrel=2
pkgdesc='Bidirectional mapping library for Python'
url='https://bidict.readthedocs.org/'
arch=('any')
license=('MPL2')
depends=(
  python
  python-typing_extensions
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-pytest
  python-sphinx
  python-sphinx-autodoc-typehints
  python-pytest-benchmark
  python-pytest-cov
  python-pytest-xdist
  python-hypothesis
  python-py-cpuinfo
  python-sortedcollections
)
source=(https://github.com/jab/bidict/archive/refs/tags/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('da32e2e9a36f34396feb4999e4bbbb5d7e97096554418b522936502a4d9ab0e5')
b2sums=('aa8606d2d48da1f8a4756bcaf450527c867f67fe284a95299df54b3c711d28d60b869a41d4494f16580c37f197263918bdd9e3d2c6bc347497caa85b4b4dd425')

build() {
  cd "bidict-${pkgver}"
  python -m build --wheel --no-isolation
}

check() {
  cd "bidict-${pkgver}"
  PYTHONPATH="build/lib" pytest
}

package() {
  cd "bidict-${pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
